//
//  QiangdanSearchConditionVC.m
//  OrderSys
//
//  Created by JM on 15/10/11.
//  Copyright © 2015年 zjlskj. All rights reserved.
//

#import "QiangdanSearchConditionVC.h"
#import "QIangdanResultVC.h"
#import "MJCellAll.h"
@interface QiangdanSearchConditionVC ()
@property(nonatomic,strong) NSMutableArray *cellArray;
@end

@implementation QiangdanSearchConditionVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.title = @"订单筛选";
    //添加确定
    UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithTitle:@"确定" style:UIBarButtonItemStyleDone target:self action:@selector(clickBtnQuery:)];
    
    self.navigationItem.rightBarButtonItem = rightButton;
    //
//    self.cellArray = @[@"车辆类型:",@"车辆状态",@"车辆长度",@"车辆吨位",@"出发地址",@"收货地址",@"订单开始时间",@"订单结束时间"];
    [self setupCells];
    
}
- (void) setupCells {
    self.cellArray = [NSMutableArray array];
    
    MJCell * cell = nil;
    cell = [LabelSelectCell cellWithLabel:@"车辆类型" forSelectArray:@[@"货车",@"自卸车",@"冷藏车",@"油罐车",@"保温车",@"起重车",@"中型罐车",@"铁笼车",@"进口气囊避震车",@"不锈钢大槽罐车"] tableView:self.tableView];
    [self.cellArray addObject:cell];
    
    cell = [LabelSelectCell cellWithLabel:@"车辆状态" forSelectArray:@[@"单桥",@"四桥",@"低栏",@"三桥",@"后八轮",@"敞篷",@"全挂",@"中栏",@"加长挂"] tableView:self.tableView];
    [self.cellArray addObject:cell];
    
    cell = [LabelSelectCell cellWithLabel:@"车辆长度" forSelectArray:@[@"2",@"2.1",@"2.2",@"2.4",@"2.6",@"2.9",@"3",@"3.1",@"3.2",@"3.3",@"3.8",@"4",@"4.2",@"4.5",@"4.6",@"4.8",@"5",@"5.3",@"5.7",@"5.8",@"6",@"6.2",@"6.5",@"6.8",@"7",@"7.3",@"7.6",@"7.7",@"7.8",@"8",@"8.2",@"8.6",@"8.8",@"9",@"9.6",@"10",@"11",@"11.5",@"12",@"12.5",@"13",@"13.5",@"14",@"16",@"17",@"17.5",@"18.5",@"19.6",@"20"] tableView:self.tableView];
    [self.cellArray addObject:cell];
    
    cell = [LabelSelectCell cellWithLabel:@"车辆吨位" forSelectArray:@[@"1",@"2",@"3",@"3.5",@"4",@"5",@"6",@"9.6",@"10",@"12",@"13",@"14",@"15",@"17",@"17.5",@"18",@"18.5",@"19",@"20",@"21",@"21.5",@"23",@"24",@"25",@"25.5",@"26",@"27",@"28",@"30",@"30.5",@"32",@"33",@"35",@"36",@"37",@"38",@"40",@"45",@"48",@"50"] tableView:self.tableView];
    [self.cellArray addObject:cell];
    
    cell = [LabelAreaSelectCell cellWithLabel:@"收货地址" tableView:self.tableView];
    [self.cellArray addObject:cell];
    
    cell = [LabelSelectCell cellWithLabel:@"收货地址" forSelectArray:@[@"宁波"] tableView:self.tableView];
    [self.cellArray addObject:cell];
    
    cell = [LabelTimeCell cellWithLabel:@"订单开始时间" tableView:self.tableView];
    [self.cellArray addObject:cell];
    cell = [LabelTimeCell cellWithLabel:@"订单结束时间" tableView:self.tableView];
    [self.cellArray addObject:cell];
    
    cell = [JMEdietrCell cellWithLabelText:@"sdsds" keyboardType:UIKeyboardTypeDefault placeholder:@""];
    [self.cellArray addObject:cell];
}


- (void)clickBtnQuery:(id) sender {
    QIangdanResultVC *vc = [[QIangdanResultVC alloc] init];
    [self.navigationController pushViewController:vc animated:YES];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableViewz{
    return 1;
}
- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.cellArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
     return self.cellArray[indexPath.row];
//    NSString *ID = @"ddddd";
//    LabelSelectCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
//    if (!cell){
//        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
//        cell.accessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"圆箭头-50x50向下.png"]];
//    }
//    //赋值
//    cell.textLabel.text = self.leftArray[indexPath.row];
//    // cell.textLabel.text = @"密码修改";
//    return cell;
}

#pragma mark-delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    MJCell *cell = self.cellArray[indexPath.row];
    [cell didSelect];
    
}

@end
